/* SHA256 Message-Digest Algorithm 
 * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 * Copyright (C) 2004 g10 Code GmbH
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __SHA256__
#define __SHA256__

#include <stdint.h>

#define SHA256_DIGEST_SIZE 32

struct SHA256Context {
	uint32_t digest[8];	// 32-byte digest
	uint32_t low, high;	// total message length in bit count
	uint8_t buffer[64];	// 64-byte message buffer(chunks)
};

void SHA256Init(struct SHA256Context *ctx);
void SHA256Update(struct SHA256Context *ctx, const void *data, unsigned int len);
void SHA256Final(unsigned char digest[32], struct SHA256Context *ctx);
void SHA256HexString(char hex[65], const unsigned char digest[32]);

#endif